package com.sale.system.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sale.common.mybatis.core.mapper.BaseMapperPlus;
import com.sale.system.api.domain.dto.SysCustomerBalance;
import com.sale.system.api.domain.dto.SysApiOrderSupplierManagementDto;
import com.sale.system.domain.SysOrderSupplierManagement;
import com.sale.system.domain.PullDown;
import com.sale.system.domain.dto.SysOrderSupplierManagementDto;
import com.sale.system.domain.vo.SysOrderSupplierManagementVo;
import com.sale.system.export.OrderSupplierManagementExport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 供应商mapper
 */
@Mapper
public interface SysOrderSupplierManagementMapper extends BaseMapperPlus<SysOrderSupplierManagementMapper, SysOrderSupplierManagement, SysOrderSupplierManagement> {

    /**
     * 供应商管理列表
     */
    Page<SysApiOrderSupplierManagementDto> getAllList(@Param("page") Page<SysApiOrderSupplierManagementDto> page, @Param("orderSupplierManagementVo") SysOrderSupplierManagementVo sysOrderSupplierManagementVo);

    /**
     * 查询供应商编号
     */
    List<SysApiOrderSupplierManagementDto> getSupplierNumMax();

    /**
     * 供应商数据导出
     */
    List<OrderSupplierManagementExport> getExportList(SysOrderSupplierManagementVo sysOrderSupplierManagementVo);

    /**
     * 通过多个id获取数据
     */
    List<OrderSupplierManagementExport> getDataByIdStr(@Param("idList") List<String> idList);

    /**
     * 获取去启用状态供应商
     */
    List<SysOrderSupplierManagementDto> getOpenSupplierList();

    /**
     * 通过单个id获取数据
     */
    SysApiOrderSupplierManagementDto getSupplierById(Long id);



    /**
     * 根据编码获取供应商信息
     */
    SysApiOrderSupplierManagementDto selectByCode(String code);

    /**
     * 通过供应商名称获取供应商编码(财务模块使用)
     */
    String getCodeBySupplierName(String supplierName);

    /**
     * 供应商下拉
     */
    List<PullDown> supplierPullDown();

    /**
     * 更新供应商余额(财务模块使用)
     */
    boolean updateSupplierBalance(SysCustomerBalance customer);
}
